2.3 Storage Locations
Data to unlock transactions must be provided, combining unlock scripts and redeem scripts for the process. In this stage, miners check the transaction signatures and other criteria for unlocking, confirming the originator of the data. Indexers use the block and UTXO transaction chains to determine the sequence of transactions, validating the authenticity of asset exchanges. The flag set for such unlock signatures is ALL | ANYONECANPAY. This protocol employs non-standard scripts for redemption, distinct from typical scripts like P2PKH, to avoid accidental UTXO spending. An example of the simplest Bitcoin script used in this protocol is given below.
2.3.1 Non-standard Scripts
The format for non-standard scripts is as follows:
- Lock script:
NOTE OP_2DROP OP_2DROP OP_2DROP Pubkey OP_CHECKSIG
- Unlock script:
Signature DATA0 DATA1 DATA2 DATA3 DATA4
2.3.2 Utilizing P2SH/P2WSH
In blockchains that facilitate P2SH/P2WSH mechanisms, the format is as follows:
- Unlock script:
Signature DATA0 DATA1 DATA2 DATA3 DATA4
- Redeem script:
NOTE OP_2DROP OP_2DROP OP_2DROP Pubkey OP_CHECKSIG
Data is stored within the segregated witness segment.
2.3.3 Employing P2TR
Like P2WSH, the redeem script is used as a branch of MAST for unlocking. The unlocking script, which includes data unlocking instructions, facilitates the unlocking.
In blockchains with P2TR mechanisms, the format is defined as follows:
- Unlock script:
Signature DATA0 DATA1 DATA2 DATA3 DATA4
- Redeem script:
NOTE OP_2DROP OP_2DROP OP_2DROP Pubkey OP_CHECKSIG
The unlock script's information is kept in the segregated witness section.
2.3.4 Full Redemption
Data can be fully stored in the witness data area, without the requirement to be placed in the unlocking script.
For example:
- Unlocking script:
Signature
- Redemption script:
DATA0 DATA1 DATA2 DATA3 DATA4 NOTE OP_2DROP OP_2DROP OP_2DROP Pubkey OP_CHECKSIG
Data saved in this format will have a different address.